# -*- coding: utf-8 -*-

#    Copyright (C) 2014 by Promotux
#                       di Francesco Meloni snc - http://www.promotux.it/

#    Author: Francesco Meloni  <francesco@promotux.it>

#    This file is part of OdCollect.

#    OdCollect is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 2 of the License, or
#    (at your option) any later version.

#    OdCollect is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with OdCollect.  If not, see <http://www.gnu.org/licenses/>.

from sqlalchemy import *
from Environment import *

t_utenteente = Table('utente_ente', meta,
        Column('id_utente', Integer, ForeignKey(fk_prefix_main+'utente.id'),primary_key=True),
        Column('id_ente', Integer, ForeignKey(fk_prefix_main+'ente.id'),primary_key=True),
        schema=mainSchema,
        extend_existing=True
        )
t_utenteente.create(checkfirst=True)

#s= select([t_roleaction.c.id_role]).execute().fetchall()
#if (1,) not in s or s ==[]:
    #ruolieazioni = t_roleaction.insert()
    #for i in range(1,15):
        #ruolieazioni.execute(id_role = 1, id_action =i)
